Image encoding/decoding method and device

ABSTRACT

An image encoding/decoding method of the present invention constructs a merge candidate list of a current block, derives motion information of the current block on the basis of the merge candidate list and a merge candidate index, and performs inter prediction on the current block on the basis of the derived motion information, wherein the merge candidate list can improve encoding/decoding efficiency by adaptively determining a plurality of merge candidates on the basis of the position or size of a merge estimation region (MER) to which the current block belongs.

TECHNICAL FIELD

The present disclosure relates to an image encoding/decoding method anddevice.

BACKGROUND ART

As a market demand for a high resolution video has increased, atechnology which may effectively compress a high resolution image isnecessary. According to such a market demand, MPEG (Moving PictureExpert Group) of ISO/IEC and VCEG (Video Coding Expert Group) of ITU-Tjointly formed JCT-VC (Joint Collaborative Team on Video Coding) todevelop HEVC (High Efficiency Video Coding) video compression standardson January 2013 and has actively conducted research and development fornext-generation compression standards.

Video compression is largely composed of intra prediction, interprediction, transform, quantization, entropy coding and in-loop filter.On the other hand, as a demand for a high resolution image hasincreased, a demand for stereo-scopic image contents has increased as anew image service. A video compression technology for effectivelyproviding high resolution and ultra high resolution stereo-scopic imagecontents has been discussed.

DISCLOSURE Technical Problem

A purpose of the present disclosure is to provide an imageencoding/decoding method and device that efficiency is improved.

In addition, a purpose of the present disclosure is to provide a methodand a device for adaptively configuring a merge candidate list of acurrent block according to a merge estimation region (MER) in a blockmerge technology.

In addition, a purpose of the present disclosure is to provide a methodand a device in which an additional merge candidate utilizes motioninformation of a block spatially separated from a current block by adistance of a plurality of pixels in configuring the merge candidatelist of a current block according to a merge estimation region in theblock merge technology of the present disclosure.

In addition, in an image encoding/decoding method and device, a purposeof the present disclosure is to provide a method and a device foreffective residual signal transform and inverse transform.

In addition, in an image encoding/decoding method and device, a purposeof the present disclosure is to provide a video coding method and deviceperforming effective motion vector coding.

In addition, a purpose of the present disclosure is to provide acomputer readable recording medium which stores a bitstream generated bythe image encoding method/device.

Technical Solution

An image decoding method and device according to the present disclosureprovides a method and a device for adaptively configuring a mergecandidate list of a current block according to a merge estimation region(MER) in a block merge technology.

A video coding method using a merge estimation region of the presentdisclosure is about a method of adaptively configuring the mergecandidate list of a current block according to a merge estimation region(MER), the merge candidate list of a current block may be adaptivelyconfigured according to a merge estimation region (MER). In this case,adaptively configuring the merge candidate list includes sharing onemerge candidate list, removing an existing merge candidate from a listor adding an additional merge candidate to a list, according to whetherto belong to the same merge estimation region as a block which isspatially or temporally adjacent to a current block.

A video coding device using a merge estimation region of the presentdisclosure is about an encoder or a decoder which adaptively configuresthe merge candidate list of a current block according to a mergeestimation region (MER), the merge candidate list of a current block maybe adaptively configured according to a merge estimation region (MER).In this case, adaptively configuring the merge candidate list includesremoving an existing merge candidate from a list or adding an additionalmerge candidate to a list according to whether to belong to the samemerge estimation region as a block which is spatially or temporallyadjacent to a current block.

In addition, in configuring the merge candidate list of a current blockaccording to a merge estimation region (MER), the additional mergecandidate may utilize motion information of a block spatially separatedfrom a current block by a distance of a plurality of pixels.

A video coding method and device according to the present disclosure isabout transform encoding and decoding among video coding technologies, amethod and a device transforming and/or inversely transforming only someresidual signals of one square or non-square block are included.

A video coding method and device according to the present disclosure isabout a method and a device which store a motion vector and a referenceimage index in video encoding and decoding and use a motion vector and areference image used around a block and in a previous image in decodingand encoding afterwards, among video coding technologies.

Advantageous Effects

According to the present disclosure, an effective imageencoding/decoding method and device may be provided by using a blockmerge technology.

In addition, as the merge candidate list of a current block isadaptively configured according to a merge estimation region (MER), animage encoding/decoding method and device improving encoding/decodingefficiency may be provided.

According to the present disclosure, an image encoding/decoding methodand device that allow effective residual signal transform and/or inversetransform may be provided.

According to the present disclosure, an image encoding/decoding methodand device that enable effective motion vector coding may be provided.

In addition, according to the present disclosure, a computer readablerecoding medium storing a bitstream generated by an image encodingmethod/device according to the present disclosure may be provided.

DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram showing an image encoding device according tothe present disclosure.

FIG. 2 is a block diagram showing an image decoding device according tothe present disclosure.

FIG. 3 shows an intra prediction method based on MPM (most probablemode) as an embodiment to which the present disclosure is applied.

FIG. 4 shows an inter prediction method based on a merge estimationregion (MER) as an embodiment to which the present disclosure isapplied.

FIG. 5 is an example on CU with the same size as MER.

FIG. 6 is a diagram showing an embodiment on CU with a smaller size thanMER.

FIG. 7 is a diagram showing another embodiment on CU with a smaller sizethan MER.

FIG. 8 shows a method in which a residual sample of a current block isencoded/decoded as an embodiment to which the present disclosure isapplied.

FIG. 9 is an example of second transform according to a block size/shapeas an embodiment to which the present disclosure is applied.

FIG. 10 shows a second transform method according to a transform matrixsize as an embodiment to which the present disclosure is applied.

FIG. 11 is a diagram showing a conceptual diagram on a method of storinga compressed motion vector.

FIG. 12 is an embodiment on a method of storing a motion vectoraccording to the present disclosure.

FIG. 13 is an embodiment on a method of extracting a motion vectoraccording to the present disclosure.

BEST MODE

An image decoding method and device according to the present disclosureprovides a method and a device for adaptively configuring a mergecandidate list of a current block according to a merge estimation region(MER) in a block merge technology.

A video coding method using a merge estimation region of the presentdisclosure is about a method of adaptively configuring the mergecandidate list of a current block according to a merge estimation region(MER), the merge candidate list of a current block may be adaptivelyconfigured according to a merge estimation region (MER). In this case,adaptively configuring the merge candidate list includes sharing onemerge candidate list, removing an existing merge candidate from a listor adding an additional merge candidate to a list, according to whetherto belong to the same merge estimation region as a block which isspatially or temporally adjacent to a current block.

A video coding device using a merge estimation region of the presentdisclosure is about an encoder or a decoder which adaptively configuresthe merge candidate list of a current block according to a mergeestimation region (MER), the merge candidate list of a current block maybe adaptively configured according to a merge estimation region (MER).In this case, adaptively configuring the merge candidate list includesremoving an existing merge candidate from a list or adding an additionalmerge candidate to a list according to whether to belong to the samemerge estimation region as a block which is spatially or temporallyadjacent to a current block.

In addition, in configuring the merge candidate list of a current blockaccording to a merge estimation region (MER), the additional mergecandidate may utilize motion information of a block spatially separatedfrom a current block by a distance of a plurality of pixels.

A video coding method and device according to the present disclosure isabout transform encoding and decoding among video coding technologies, amethod and a device transforming and/or inversely transforming only someresidual signals of one square or non-square block are included.

A video coding method and device according to the present disclosure isabout a method and a device which store a motion vector and a referenceimage index in video encoding and decoding and use a motion vector and areference image used around a block and in a previous image in decodingand encoding afterwards, among video coding technologies.

MODE FOR INVENTION

Referring to a diagram attached in this description, an embodiment ofthe present disclosure is described in detail so that a person withordinary skill in the art to which the inventions pertain may easilycarry it out. But, the present disclosure may be implemented in avariety of different shapes and is not limited to an embodiment which isdescribed herein. And, a part irrelevant to description is omitted and asimilar diagram code is attached to a similar part through thedescription to clearly describe the present disclosure in a diagram.

In this description, when a part is referred to as being ‘connected to’other part, it includes a case that it is electrically connected whileintervening another element as well as a case that it is directlyconnected.

In addition, in this description, when a part is referred to as‘including’ a component, it means that other components may beadditionally included without excluding other components, unlessotherwise specified.

In addition, a term such as first, second, etc. may be used to describevarious components, but the components should not be limited by theterms. The terms are used only to distinguish one component from othercomponents.

In addition, in an embodiment on a device and a method described in thisdescription, some configurations of the device or some steps of themethod may be omitted. In addition, the order of some configurations ofthe device or some steps of the method may be changed. In addition,another configuration or another step may be inserted in someconfigurations of the device or some steps of the method.

In addition, some configurations or some steps in a first embodiment ofthe present disclosure may be added to a second embodiment of thepresent disclosure or may be replaced with some configurations or somesteps in the second embodiment.

In addition, as construction units shown in an embodiment of the presentdisclosure are independently shown to represent different characteristicfunctions, it does not mean that each construction unit is configured inseparate hardware or one software construction unit. In other words,each construction unit may be described by being enumerated as eachconstruction unit for convenience of description, at least twoconstruction units among each construction unit may be combined toconfigure one construction unit or one construction unit may be dividedinto a plurality of construction units to perform a function. Such anintegrated embodiment and separated embodiment in each construction unitare also included in a scope of a right on the present disclosure aslong as they are not beyond the essence of the present disclosure.

First, a term used in this application is simply described as follows.

A decoding device (Video Decoding Apparatus) which will be describedafter may be a device included in a server terminal such as a privatesecurity camera, a private security system, a military security camera,a military security system, a personal computer (PC), a notebook, aportable multimedia player (PMP), a wireless communication terminal, asmart phone, a TV application server and a service server, etc. and meanvarious devices equipped with a user terminal such as all kinds ofinstruments, etc., a communication device such as a communication modem,etc. for communicating with an wire and wireless communication network,a memory for storing all kinds of programs and data for inter or intraprediction to encode or decode an image, a microprocessor for programoperation and control by running it and so on.

In addition, an image encoded in a bitstream by an encoder may betransmitted to an image decoding device through a wire and wirelesscommunication network, etc. such as the Internet, a wireless local areanetwork, a wireless Lan network, a wibro network, a mobile radiocommunication network, etc. or through various communication interfacessuch as a cable, an universal serial bus, etc. in real-time or innon-real-time and may be decoded. And it may be reconstructed into animage and played. Alternatively, a bitstream generated by an encoder maybe stored in a memory. The memory may include both a volatile memory anda nonvolatile memory. In this description, a memory may be representedas a recording medium which stores a bitstream.

Generally, a video may be configured with a series of pictures and eachpicture may be partitioned into a coding unit like a block. In addition,a person with ordinary skill in the art to which the embodiment pertainsmay understand that a term ‘picture’ described below may be used bybeing substituted for other terms with the same meaning such as Image,Frame, etc. And, a person with ordinary skill in the art to which theembodiment pertains may understand that a term ‘coding unit’ may be usedby being substituted for other terms with the same meaning such as aunit block, a block, etc.

Hereinafter, referring to the attached diagrams, an embodiment of thepresent disclosure will be described in more detail. In describing thepresent disclosure, overlapping description for the same component isomitted.

FIG. 1 is a block diagram showing an image encoding device according tothe present disclosure.

In reference to FIG. 1, an image encoding device 100 may include apicture partition unit 110, a prediction unit 120, 125, a transform unit130, a quantization unit 135, a rearrangement unit 160, an entropyencoding unit 165, a dequantization unit 140, an inverse transform unit145, a filter unit 150 and a memory 155.

A picture partition unit 110 may partition an input picture into atleast one processing unit. In this case, a processing unit may be aprediction unit (PU), a transform unit (TU) or a coding unit (CU).Hereinafter, in an embodiment of the present disclosure, a coding unitmay be used as a unit performing encoding and may be used as a unitperforming decoding.

A prediction unit may be partitioned in at least one square shape orrectangular shape, etc. with the same size within one coding unit andmay be partitioned so that any one prediction unit among predictionunits partitioned in one coding unit will have a shape and/or sizedifferent from another prediction unit. When it is not a minimum codingunit in generating a prediction unit which performs intra predictionbased on a coding unit, intra prediction may be performed without beingpartitioned into a plurality of prediction units, N×N.

A prediction unit 120 and 125 may include an inter prediction unit 120performing inter prediction and an intra prediction unit 125 performingintra prediction. Whether to perform inter prediction or intraprediction for a prediction unit may be determined and concreteinformation according to each prediction method (e.g., an intraprediction mode, a motion vector, a reference picture, etc.) may bedetermined. A residual value (a residual block) between a generatedprediction block and an original block may be input into a transformunit 130. In addition, prediction mode information, motion vectorinformation, etc. used for prediction may be encoded in an entropyencoding unit 165 with a residual value and transmitted to a decoder. Anintra prediction method will be described in detail by referring to FIG.3 and an inter prediction method will be described in detail byreferring to FIG. 4 to 7, respectively.

In applying the above-mentioned block merge technology of the presentdisclosure, a method of using a merge estimation region (MER) byconsidering a parallel processing may be applied to a prediction unit120 and 125 when a current block is used by merging motion informationof a block which is spatially or temporally adjacent. In other words,the present disclosure may utilize a parallel estimation region (PER)for configuring a block which is spatially or temporally adjacent to acurrent block by considering a parallel processing in a predictiontechnology such as inter prediction, intra prediction, inter-componentprediction, etc. among video coding technologies.

An inter prediction unit 120 may predict a prediction unit based oninformation of at least one picture of a previous picture or asubsequent picture of a current picture and may predict a predictionunit based on information of a partial region which is encoded in acurrent picture in some cases. An inter prediction unit 120 may includea reference picture interpolation unit, a motion prediction unit and amotion compensation unit.

In a reference picture interpolation unit, reference picture informationmay be provided from a memory 155 and pixel information below an integerpixel may be generated in a reference picture. For a luma pixel, aDCT-based 8-tap interpolation filter with a different filter coefficientmay be used to generate pixel information below an integer pixel in a ¼pixel unit. For a chroma signal, a DCT-based 4-tap interpolation filterwith a different filter coefficient may be used to generate pixelinformation below an integer pixel in a ⅛ pixel unit.

A motion prediction unit may perform motion prediction based on areference picture interpolated by a reference picture interpolationunit. As a method for calculating a motion vector, various methods suchas FBMA (Full search-based Block Matching Algorithm), TSS (Three StepSearch), NTS(New Three-Step Search Algorithm), etc. may be used. Amotion vector may have a motion vector value in a ½ or ¼ pixel unitbased on an interpolated pixel. In a motion prediction unit, a currentprediction unit may be predicted by making a motion prediction methoddifferent. For a motion prediction method, various methods such as askip method, a merge method, a AMVP (Advanced Motion Vector Prediction)method, an intra block copy method, etc. may be used.

An intra prediction unit 125 may generate a prediction unit based onreference pixel information around a current block, pixel information ina current picture. When a reference pixel is a pixel which performedinter prediction because a surrounding block in a current predictionunit is a block which performed inter prediction, a reference pixelincluded in a block which performed inter prediction may be used bybeing substituted with reference pixel information of a block whichperformed surrounding intra prediction. In other words, when a referencepixel is unavailable, unavailable reference pixel information may beused by being substituted with at least one reference pixel of availablereference pixels.

In addition, a residual block including residual value information, adifference value between a prediction unit which performs predictionbased on a prediction unit generated in a prediction unit 120 and 125and an original block in a prediction unit, may be generated. Agenerated residual block may be input into a transform unit 130.

In a transform unit 130, an original block and a residual blockincluding residual value information in a prediction unit generated in aprediction unit 120 and 125 may be transformed by using a transformmethod such as DCT (Discrete Cosine Transform), DST (Discrete SineTransform), KLT. Whether to apply DCT, DST or KLT to transform aresidual block may be determined based on intra prediction modeinformation in a prediction unit used to generate a residual block. Atransform method will be described in detail by referring to FIG. 8 to10.

A quantization unit 135 may quantize values which are transformed into afrequency domain in a transform unit 130. According to a block oraccording to image importance, a quantized coefficient may be changed. Avalue calculated in a quantization unit 135 may be provided to adequantization unit 140 and a rearrangement unit 160.

A rearrangement unit 160 may perform the rearrangement of a coefficientvalue for a quantized residual value.

A rearrangement unit 160 may change a two-dimensional block-shapedcoefficient into a one-dimensional vector shape through a coefficientscanning method. For example, in a rearrangement unit 160, a DCcoefficient to a coefficient in a high frequency domain may be scannedby a zig-zag scanning method and may be changed into a one-dimensionalvector shape. A vertical scan which scans a two-dimensional block-shapedcoefficient by column or a horizontal scan which scans a two-dimensionalblock-shaped coefficient by row may be used instead of a zig-zag scanaccording to a size of a transform unit and an intra prediction mode. Inother words, whether which scanning method among a zig-zag scan, avertical directional scan and a horizontal directional scan will be usedmay be determined according to a size of a transform unit and an intraprediction mode.

An entropy encoding unit 165 may perform entropy encoding based onvalues calculated by a rearrangement unit 160. For example, entropyencoding may use various coding methods such as Exponential Golomb,CAVLC (Context-Adaptive Variable Length Coding), CABAC (Context-AdaptiveBinary Arithmetic Coding). Regarding it, an entropy encoding unit 165may encode residual value coefficient information in a coding unit froma rearrangement unit 160 and a prediction unit 120, 125. In addition,according to the present disclosure, it is possible to signal andtransmit information indicating that motion information is derived interms of a decoder and used and information on a method used forderiving motion information.

In a dequantization unit 140 and an inverse transform unit 145, valuesquantized in a quantization unit 135 are dequantized and valuestransformed in a transform unit 130 are inversely transformed. Aresidual value generated in a dequantization unit 140 and an inversetransform unit 145 may generate a reconstructed block by being combinedwith a prediction unit which is predicted through a motion predictionunit, a motion compensation unit and an intra prediction unit includedin a prediction unit 120 and 125.

A filter unit 150 may include at least one of a deblocking filter, anoffset modification unit and ALF (Adaptive Loop Filter). A deblockingfilter may remove block distortion generated by a boundary betweenblocks in a reconstructed picture. An offset modification unit maymodify an offset with an original image in a pixel unit for an imageperforming deblocking. A method in which a pixel included in an image isdivided into the certain number of regions, a region which will performan offset is determined and an offset is applied to the correspondingregion or a method in which an offset is applied by considering edgeinformation of each pixel may be used to perform offset modification fora specific picture. ALF (Adaptive Loop Filter) may be performed based ona value comparing a filtered reconstructed image with an original image.A pixel included in an image may be divided into a predetermined group,one filter which will be applied to the corresponding group may bedetermined and a filtering may be performed discriminately per group.

A memory 155 may store a reconstructed block or picture calculated in afilter unit 150 and a stored reconstructed block or picture may beprovided for a prediction unit 120 and 125 when inter prediction isperformed.

FIG. 2 is a block diagram showing an image decoding device according tothe present disclosure.

In reference to FIG. 2, an image decoder 200 may include an entropydecoding unit 210, a rearrangement unit 215, a dequantization unit 220,an inverse transform unit 225, a prediction unit 230 and 235, a filterunit 240 and a memory 245.

When an image bitstream is input in an image encoder, an input bitstreammay be decoded in a process opposite to that of an image encoder.

An entropy decoding unit 210 may perform entropy decoding in a processopposite to a process in which entropy encoding is performed in anentropy encoding unit of an image encoder. For example, in response to amethod performed in an image encoder, various methods such asExponential Golomb, CAVLC (Context-Adaptive Variable Length Coding) andCABAC (Context-Adaptive Binary Arithmetic Coding) may be applied.

In an entropy decoding unit 210, information related to intra predictionand inter prediction performed in an encoder may be decoded.

A rearrangement unit 215 may perform rearrangement for a bitstreamentropy-decoded in an entropy decoding unit 210, based on arearrangement method of an encoding unit. Coefficients represented in aone-dimensional vector shape may be reconstructed into coefficients in atwo-dimensional block shape and may be rearranged.

A dequantization unit 220 may perform dequantization based on aquantization parameter provided in an encoder and a coefficient value ofa rearranged block.

An inverse transform unit 225 may perform inverse DCT, inverse DST andinverse KLT, i.e., inverse transform for DCT, DST and KLT, i.e.,transform performed in a transform unit for a result of quantizationperformed in an image encoder. Inverse transform may be performed basedon a transmission unit determined in an image encoder. In the inversetransform unit 225 of an image decoder, a transform method (e.g., DCT,DST, KLT) may be selectively performed according to a plurality ofinformation such as a prediction method, a size of a current block, aprediction direction, etc. An inverse transform method will be describedin detail by referring to FIG. 8 to 10.

A prediction unit 230 and 235 may generate a prediction block based oninformation related to prediction block generation provided in anentropy decoding unit 210 and pre-decoded block or picture informationprovided in a memory 245.

As described above, when a size of a prediction unit is the same as thatof a transform unit in performing intra prediction in the same manner asoperation in an image encoder, intra prediction for a prediction unitmay be performed based on a pixel at the left of a prediction unit, apixel at the left top and a pixel at the top, but when the size of aprediction unit is different from that of a transform unit in performingintra prediction, intra prediction may be performed by using a referencepixel based on a transform unit. In addition, intra prediction using N×Npartitions only for a minimum coding unit may be used.

A prediction unit 230 and 235 may include a prediction unitdetermination unit, an inter prediction unit and an intra predictionunit. A prediction unit determination unit may receive a variety ofinformation such as prediction unit information, prediction modeinformation of an intra prediction method, information related to motionprediction of an inter prediction method, etc. which are input from anentropy decoding unit 210, classify a prediction unit in a currentcoding unit and determine whether a prediction unit performs interprediction or intra prediction.

In addition, in applying the above-mentioned block merge technology ofthe present disclosure, a method of using a merge estimation region byconsidering a parallel processing may be applied to a prediction unit230 and 235 when a current block is used by merging motion informationof a block which is spatially or temporally adjacent. In other words,the present disclosure may utilize a parallel estimation region forconfiguring a block which is spatially or temporally adjacent to acurrent block by considering a parallel processing in a predictiontechnology such as inter prediction, intra prediction, inter-componentprediction, etc. among video coding technologies.

An inter prediction unit 230 may perform inter prediction on a currentprediction unit based on information included in at least one picture ofa previous picture or a subsequent picture of a current pictureincluding a current prediction unit by using information necessary forinter prediction of a current prediction unit provided by an imageencoder. To perform inter prediction, whether a motion prediction methodin a prediction unit included in a corresponding coding unit based on acoding unit is a skip mode, a merge mode, a AMVP mode or an intra blockcopy mode may be determined. An inter prediction method will bedescribed in detail by referring to FIG. 4 to FIG. 7, respectively.

An intra prediction unit 235 may generate a prediction block based onpixel information in a current picture. When a prediction unit is aprediction unit which performs intra prediction, intra prediction may beperformed based on intra prediction mode information in a predictionunit provided by an image encoder. An intra prediction unit 235 mayinclude an adaptive intra smoothing (AIS) filter, a reference pixelinterpolation unit and a DC filter. As a part performing filtering onthe reference pixel of a current block, an AIS filter may be applied bydetermining whether a filter is applied according to a prediction modein a current prediction unit. AIS filtering may be performed on thereference pixel of a current block by using a prediction mode in aprediction unit and AIS filter information provided by an image encoder.When the prediction mode of a current block is a mode where AISfiltering is not performed, an AIS filter may not be applied.

When a prediction mode in a prediction unit is a prediction unit inwhich intra prediction is performed based on a pixel value interpolatinga reference pixel, a reference pixel interpolation unit may interpolatea reference pixel to generate a reference pixel in a pixel unit below aninteger value. When a prediction mode in a current prediction unit is aprediction mode which generates a prediction block without interpolatinga reference pixel, a reference pixel may not be interpolated. A DCfilter may generate a prediction block through filtering when theprediction mode of a current block is a DC mode. An intra predictionmethod will be described in detail by referring to FIG. 3.

A reconstructed block or picture may be provided to a filter unit 240. Afilter unit 240 may include a deblocking filter, an offset modificationunit and an ALF.

Information on whether a deblocking filter is applied to a correspondingblock or picture and information on whether a strong filter or a weakfilter is applied when a deblocking filter is applied may be provided byan image encoder. A deblocking filter of an image decoder may receiveinformation related to a deblocking filter provided by man image encoderand perform deblocking filtering for a corresponding block in an imagedecoder.

An offset modification unit may perform offset modification on areconstructed image based on a type of offset modification, offset valueinformation, etc. applied to an image in encoding. An ALF may be appliedto a coding unit based on information on whether an ALF is applied, ALFcoefficient information, etc. provided by an encoder. Such ALFinformation may be provided by being included in a specific parameterset.

A memory 245 may store a reconstructed picture or block for use as areference picture or a reference block and provide a reconstructedpicture to an output unit.

FIG. 3 shows an intra prediction method based on MPM (most probablemode) as an embodiment to which the present disclosure is applied.

In reference to FIG. 3, a MPM list for the intra prediction of a currentblock may be configured S300.

A MPM list of the present disclosure may include a plurality of MPMs andMPMs may be determined based on the intra prediction mode of aneighboring block of a current block. The number of MPMs may be n and nmay be an integer such as 3, 4, 5, 6 or more.

For example, a MPM list may include at least one of an intra predictionmode of a neighboring block (modeA), (modeA−i), (modeA+i) or a defaultmode. A value of i may be an integer such as 1, 2, 3, 4 or more. Theneighboring block may mean a block adjacent to the left and/or top of acurrent block. A default mode may be at least one of a Planar mode, a DCmode or a predetermined directional mode. A predetermined directionalmode may include at least one of a horizontal mode (modeV), a verticalmode (modeH), (modeV−j), (modeV+j), (modeH−j) or (modeH+j). A value of jmay be an arbitrary natural number less than or equal to 16.

An intra prediction mode may be derived based on the MPM list and a MPMindex S310.

The MPM index may specify the same MPM as an intra prediction mode of aluma component block in a MPM list. A MPM specified by a MPM index maybe set as an intra prediction mode of a current block.

Alternatively, the intra prediction mode of a current block may bederived by applying a predetermined offset to a MPM specified by the MPMindex.

Applying the offset may be selectively performed based on at least oneof block attributes, i.e., a size, a shape, partition information,partition depth, a value of an intra prediction mode or a componenttype. In this case, a block may mean the current block and/or aneighboring block of a current block.

The offset may be applied only when a size of a current block is smallerthan or the same as a predetermined first threshold value. In this case,the first threshold value may mean the maximum block size to which anoffset is applied. Alternatively, it may be applied only when the sizeof a current block is greater than or the same as a predetermined secondthreshold value. In this case, the second threshold value may mean theminimum block size to which an offset is applied. The first/secondthreshold value may be signaled through a bitstream. Alternatively, itmay be variably determined in a decoding device based on at least one ofthe above-mentioned block attributes, and may be a fixed value which ispre-promised in an encoding/decoding device.

Alternatively, the offset may be applied only when the shape of acurrent block is non-square. In an example, when the followingconditions are satisfied, IntraPredMode, an intra prediction mode of acurrent block, may be derived by adding a predetermined offset (e.g.,65) to the MPM.

-   -   nW is greater than nH    -   IntraPredMode is greater than or equal to 2    -   IntraPredMode is less than (whRatio>1) ? (8+2*whRatio): 8

In this case, nW and nH may represent the width and height of a currentblock, respectively and whRatio may be set as Abs (Log 2 (nW/nH)).

Alternatively, when the following conditions are satisfied,IntraPredMode of a current block may be derived by subtracting apredetermined offset (e.g., 67) from the MPM.

-   -   nH is greater than nW    -   IntraPredMode is greater than or equal to 66    -   IntraPredMode is less than (whRatio>1) ? (60−2*whRatio): 60

By using the intra prediction mode, the intra prediction of a currentblock may be performed S320.

Concretely, a prediction sample of a current block may be derived byusing a reference sample specified by an intra prediction mode. In thiscase, a current block may be partitioned into a plurality of sub-blocksand intra prediction may be performed in a unit of each sub-block. Eachsub-block may be predicted in parallel and may bepredicted/reconstructed sequentially according to the predeterminedcoding order.

Partition into the sub-blocks may be performed based on predeterminedpartition information. The partition information may include at leastone of first information representing whether a current block ispartitioned into a plurality of sub-blocks, second informationrepresenting a partition direction (e.g., horizontal or vertical) orthird information on the number of partitioned sub-blocks. The partitioninformation may be encoded in an encoding device and signaled.Alternatively, some of the partition information may be variablydetermined, in a decoding device, based on the above-mentioned blockattributes, and may be set as a fixed value which is predefined in anencoding/decoding device.

For example, when the first information is a first value, a currentblock may be partitioned into a plurality of sub-blocks and otherwise, acurrent block may not be partitioned into a plurality of sub-blocks(NO_SPLIT). When a current block is partitioned into a plurality ofsub-blocks, a current block may be horizontally partitioned (HOR_SPLIT)or vertically partitioned (VER_SPLIT) based on the second information.In this case, a current block may be partitioned into r sub-blocks. Inthis case, a value of r may be an integer such as 2, 3, 4 or more.Alternatively, a value of r may be limited to exponentiation of 2 suchas 1, 2, 4, etc. Alternatively, when at least one of width or height ofa current block is 4 (e.g., 4×8, 8×4), the k may be set to be 2 andotherwise, the k may be set to be 4, 8, or 16. When a current block isnot partitioned (NO_SPLIT), the k may be set to be 1.

The current block may be partitioned into sub-blocks with the same widthand height, and may be partitioned into sub-blocks with different widthand height. A current block may be partitioned in a pre-promised N×Mblock unit (e.g., 2×2, 2×4, 4×4, 8×4, 8×8, etc.) in an encoding/decodingdevice regardless of the above-mentioned block attributes.

FIG. 4 shows an inter prediction method based on a merge estimationregion (MER) as an embodiment to which the present disclosure isapplied.

The present disclosure is about a block merge technology for interprediction among video coding technologies. A current block may bepredicted by merging with motion information of at least one of aspatial neighboring block or a temporal neighboring block. Theprediction may be performed based on a merge estimation region for aparallel processing.

In addition, the present disclosure suggests a parallel estimationregion (PER) for configuring a neighboring block of a current block in aprediction method such as inter prediction, intra prediction,inter-component prediction, etc. among video coding technologies. Theneighboring block may mean a region which is spatially and/or temporallyadjacent to a current block. One or more blocks belonging to theparallel estimation region (PER) may be processed in parallel.

In a block merge technology of the present disclosure, a merge candidatelist of a current block may be adaptively configured according to amerge estimation region (MER). In this case, the merge candidate listmay be configured by removing an existing merge candidate from a list oradding an additional merge candidate to a list according to whether tobelong to the same merge estimation region as a neighboring block of acurrent block.

In a block merge technology of the present disclosure, when the mergecandidate list of a current block is configured according to a mergeestimation region, the additional merge candidate may be a blockspatially separated from a current block by a distance of a plurality ofpixels.

When prediction candidates of a current block of the present disclosureare configured, a prediction candidate which is spatially and/ortemporally adjacent by considering a parallel estimation region (PER)may be a block spatially separated from a current block by a distance ofa plurality of pixels or a block temporally positioned at a specificpicture distance or farther.

In a video coding method and device suggested in the present disclosure,a parallel estimation region (PER) may be used to configure a referencepixel for inter-component prediction, a template for template matching,a motion reference block for inter prediction, etc.

FIG. 4 shows a plurality of coding units configuring one block andvarious block partition structures.

Among a plurality of coding units configuring one block, a mergeestimation region for a parallel processing may be set. The coding unitsin the merge estimation region do not have interdependency and thecorresponding coding units may be processed in parallel. In reference toFIG. 4, the concept of a merge estimation region (MER) will bedescribed.

In FIG. 4, a 64×64 block 411 may be partitioned into a plurality ofcoding units. The partition may be performed by using at least onepartition method of quad-tree block partition, binary-tree blockpartition or ternary-tree block partition. The partition may berecursively performed.

When a 64×64 block 411 is partitioned into a total of 11 coding units400˜410 by using the block partition to perform encoding and/ordecoding, FIG. 4 shows an example of setting a merge estimation region(MER) suggested by the present disclosure. In this case, in an exampleshown in FIG. 4, a merge estimation region is configured with a 32×32pixel region 412, and encoding and/or decoding is performed by removingevery reference dependency so that there will be no dependency betweencoding units in the corresponding region.

When the corresponding region is a merge estimation region (MER), acoding unit in the same merge estimation region in a process ofgenerating each block merge candidate list for CU1, CU2, CU3, CU4 is notadded as a merge candidate.

The present disclosure includes adding a block outside the correspondingmerge estimation region as a merge candidate instead of not adding acoding unit in the same merge estimation region in a process ofgenerating the merge candidate list as a merge candidate. It will bedescribed in detail by referring to FIG. 5 to FIG. 7.

In addition, when the corresponding region is a parallel estimationregion, reference pixels used for inter-component prediction, templateprediction, etc. for CU1, CU2, CU3, CU4 are configured by using pixelsoutside the corresponding parallel estimation region.

Alternatively, all or some of coding units belonging to a mergeestimation region may share one merge candidate list. The mergecandidate of a current block may include a spatial/temporal neighboringblock of a merge estimation region. In this case, a current block maymean any one of a plurality of coding units belonging to a mergeestimation region, and may mean a coding unit which is no longerpartitioned into a smaller coding unit. A merge estimation region may bea higher block (or a higher coding unit) having a partition depth (splitdepth) smaller than a current block. For example, when the split depthof a current block is k, the split depth of a merge estimation regionmay be (k−1), (k−2), (k−3), etc. A current block may be obtained bypartitioning a merge estimation region based on any one of theabove-mentioned partition methods. Alternatively, a current block may beobtained by partitioning a merge estimation region based on at least twoof the above-mentioned partition methods.

Generally, the merge candidate of a current block may be determined as aneighboring block adjacent to at least one of the left, the bottom-left,the top, the top-right or the top-left of a current block. It is assumedthat the position of a top-left sample of a current block is (xc, yc)and the width and height of a current block is Wc and Hc, respectively.In this case, a left neighboring block may be a block including a(xc−1,yc+Hc−1) sample, a bottom-left neighboring block may be a blockincluding a (xc−1,yc+Hc) sample, a top neighboring block may be a blockincluding a (xc+Wc−1,yc−1) sample, a top-right neighboring block may bea block including a (xc+Wc,yc−1) sample and a top-left neighboring blockmay be a block including a (xc−1,yc−1) sample.

But, when a current block belongs to a merge estimation region, themerge candidate of a current block may be determined as a neighboringblock adjacent to at least one of the left, the bottom-left, the top,the top-right or the top-left of a merge estimation region. It isassumed that the position of a top-left sample of the merge estimationregion is (xs, ys) and the width and height of the merge estimationregion is Ws and Hs, respectively. In this case, a left neighboringblock may be a block including a (xs−1,ys+Hs−1) sample, a bottom-leftneighboring block may be a block including a (xs−1,ys+Hs) sample, a topneighboring block may be a block including a (xs+Ws−1,ys−1) sample, atop-right neighboring block may be a block including a (xs+Ws,ys−1)sample and a top-left neighboring block may be a block including a(xs−1,ys−1) sample.

In the above-mentioned method, a coding unit belonging to a mergeestimation region may use the same merge candidate or merge candidatelist. For this, when a current block belongs to a merge estimationregion, the above-mentioned position/size information of a current blockmay be set as position/size information of a merge estimation region.Based on set position/size information, the merge candidate of a currentblock may be derived. Based on a derived merge candidate, the mergecandidate list of a current block may be configured.

Based on the merge candidate list and a merge candidate index, motioninformation of a current block may be derived. A merge candidate indexmay specify any one of a plurality of merge candidates belonging to themerge candidate list and specify a merge candidate having motioninformation of a current block. The merge candidate index may besignaled for each coding unit belonging to a merge estimation region.

Hereinafter, a method of setting a merge estimation region (MER) will bedescribed.

When the split depth of a current block is k, a higher block to which acurrent block belongs is a block with a split depth of (k−i) and in thiscase, i may be 1, 2, . . . , k−1, k. A higher block which satisfies apredetermined condition among the higher blocks may be set as a mergeestimation region. In other words, a merge estimation region may bedefined as a higher block of a node sharing a merge candidate or a mergecandidate list. But, when there are a plurality of higher blocks whichsatisfy a predetermined condition, a higher block with the smallestsplit depth may be set as a merge estimation region or a higher blockwith the largest split depth may be set as a merge estimation region.

In an example, when the number of samples belonging to a higher block issmaller than or the same as a predetermined first threshold value, thehigher block may be set as a merge estimation region. The firstthreshold value may be signaled from an encoding device and thesignaling may be performed in at least one level of a video sequence, apicture, a slice, a tile or CTU. Alternatively, the first thresholdvalue may be a fixed value which is predefined in an encoding/decodingdevice. The first threshold value may be 32, 64, 128, 256 or more.

Alternatively, when a higher block is partitioned into two based onbinary-tree block partition and the number of samples belonging to ahigher block is smaller than or the same as a predetermined secondthreshold value, the corresponding higher block may be set as a mergeestimation region. The second threshold value may be signaled from anencoding device and the signaling may be performed in at least one levelof a video sequence, a picture, a slice, a tile or CTU. Alternatively,the second threshold value may be a fixed value which is predefined inan encoding/decoding device. The second threshold value may be 32, 64,128, 256 or more.

For example, it is assumed that the second threshold value is 64 and ahigher block is 4×8. In this case, when a higher block is partitionedinto two based on binary-tree block partition, a higher block may beconfigured with two 4×4 lower blocks. It may mean that there is a lowerblock in which the number of samples is smaller than 32 in the higherblock. When the number of samples belonging to a higher block is smallerthan 64 and there is a lower block in which the number of samples issmaller than 32, the higher block may be set as a merge estimationregion and two lower blocks belonging to the higher block may share onemerge candidate list. Alternatively, when a higher block is partitionedinto three based on ternary-tree block partition and the number ofsamples belonging to a higher block is smaller than or the same as apredetermined third threshold value, the corresponding higher block maybe set as a merge estimation region. The third threshold value may besignaled from an encoding device and the signaling may be performed inat least one level of a video sequence, a picture, a slice, a tile orCTU. Alternatively, the third threshold value may be a fixed value whichis predefined in an encoding/decoding device. The third threshold valuemay be 32, 64, 128, 256 or more.

For example, it is assumed that the third threshold value is 128 and ahigher block is 4×16. In this case, when a higher block is partitionedinto three based on ternary-tree block partition, a higher block may beconfigured with two 4×4 lower blocks and one 4×8 lower block. It maymean that there is a lower block in which the number of samples issmaller than 32 in the higher block. When the number of samplesbelonging to a higher block is smaller than 128 and there is a lowerblock in which the number of samples is smaller than 32, the higherblock may be set as a merge estimation region and three lower blocksbelonging to the higher block may share one merge candidate list.

Alternatively, when a higher block is partitioned into four based onquad-tree block partition and the number of samples belonging to ahigher block is smaller than or the same as a predetermined fourththreshold value, the corresponding higher block may be set as a mergeestimation region. The fourth threshold value may be signaled from anencoding device and the signaling may be performed in at least one levelof a video sequence, a picture, a slice, a tile or CTU. Alternatively,the fourth threshold value may be a fixed value which is predefined inan encoding/decoding device. The fourth threshold value may be 32, 64,128, 256 or more.

For example, it is assumed that the fourth threshold value is 128 and ahigher block is 8×8. In this case, when a higher block is partitionedinto four based on quad-tree block partition, a higher block may beconfigured with four 4×4 lower blocks. It may mean that there is a lowerblock in which the number of samples is smaller than 32 in the higherblock. When the number of samples belonging to a higher block is smallerthan 128 and there is a lower block in which the number of samples issmaller than 32, the higher block may be set as a merge estimationregion and four lower blocks belonging to the higher block may share onemerge candidate list.

Alternatively, only when a ratio of width and height of a higher block(W/H or H/W) is smaller than or the same as a predetermined fifththreshold value, the corresponding higher block may be set as a mergeestimation region. The fifth threshold value may be signaled from anencoding device and the signaling may be performed in at least one levelof a video sequence, a picture, a slice, a tile or CTU. Alternatively,the fifth threshold value may be a fixed value which is predefined in anencoding/decoding device. The fifth threshold value may be 2, 4, 8, 16or more. For example, when a higher block is a 32×4 block and the fifththreshold value is 4, the higher block may not be set as a mergeestimation region. When a higher block is a 4×32 block and the fifththreshold value is 8, the higher block may be set as a merge estimationregion.

Alternatively, only when any one of width and height of a higher blockis smaller than or the same as a predetermined sixth threshold value,the corresponding higher block may be set as a merge estimation region.In this case, the maximum value of width and height of a higher blockmay be compared with the sixth threshold value. The sixth thresholdvalue may be signaled from an encoding device and the signaling may beperformed in at least one level of a video sequence, a picture, a slice,a tile or CTU. Alternatively, the sixth threshold value may be a fixedvalue which is predefined in an encoding/decoding device. The sixththreshold value may be 16, 32, 64 or more. For example, when a higherblock is a 32×4 block and the sixth threshold value is 16, the higherblock may not be set as a merge estimation region. When a higher blockis a 4×16 block and the sixth threshold value is 32, the higher blockmay be set as a merge estimation region.

Alternatively, when the number of samples belonging to a higher block issmaller than or the same as a seventh threshold value and there is atleast one lower block in which the number of samples is smaller than pin the higher block, the higher block may be set as a merge estimationregion. The seventh threshold value may be signaled from an encodingdevice and the signaling may be performed in at least one level of avideo sequence, a picture, a slice, a tile or CTU. Alternatively, theseventh threshold value may be a fixed value which is predefined in anencoding/decoding device. The seventh threshold value may be 32, 64, 128or more. The p may be 16, 32, 64 or more. The lower block may bedetermined by partitioning the higher block based on at least one of theabove-mentioned partition methods.

A merge estimation region may be set based on any one of theabove-mentioned conditions. Alternatively, a merge estimation region maybe set based on a combination of at least two conditions.

When a higher block is partitioned by a predetermined partition method,the corresponding higher block may be limited so that it is not set as amerge estimation region. In this case, a predetermined partition methodmay include at least one of quad-tree block partition, binary-tree blockpartition or ternary-tree block partition. For example, when a higherblock is partitioned based on quad-tree block partition, thecorresponding higher block may not be set as a merge estimation region.Inversely, only when a higher block is partitioned by a predeterminedpartition method, the corresponding higher block may be limited so thatit is set as a merge estimation region. For example, only when a higherblock is partitioned based on binary-tree block partition and/orternary-tree block partition, the corresponding higher block may be setas a merge estimation region.

As mentioned above, a merge estimation region may be determined byconsidering only a size/shape of a higher block. Alternatively, a mergeestimation region may be determined by considering a size/shape of ahigher block and a lower block. But, it is not limited thereto and amerge estimation region may be determined by considering only asize/shape of a lower block.

An encoding device may determine the optimum size of a merge estimationregion and encode information representing a determined size to signalit to a decoding device. The encoded information may be signaled in atleast one level of a video sequence, a picture, a slice, a tile or CTU.Alternatively, the size of a merge estimation region may be a fixed sizewhich is predefined in an encoding/decoding device.

Alternatively, a merge estimation region may not be limited to a squareshape, and information on width and height of a merge estimation regionmay be independently signaled. A merge estimation region may have anon-square shape that the width and height are different from eachother. Alternatively, for the size or range of a merge estimationregion, using a predefined size or range may be also included in a scopeof the present disclosure.

An embodiment on the above-mentioned merge estimation region (MER) maybe equally/similarly applied to a parallel estimation region anddetailed description will be omitted.

FIG. 5 is an example on CU with the same size as MER.

FIG. 5 is a diagram showing merge candidates which are spatiallyadjacent to CU with the same size as MER.

As in FIG. 5, for CU with the same size as MER or with a larger sizethan MER, a process of excluding merge candidates which are spatiallyadjacent in a process of generating a merge candidate list is notincluded.

In addition, the corresponding concept may be applied to a parallelestimation region (PER) as well as MER shown in FIG. 5.

FIG. 5 is a diagram showing merge candidates which are spatiallyadjacent to CU 500 with the same size as MER.

As in FIG. 5, for CU with the same size as MER or with a larger sizethan MER, a process of excluding merge candidates which are spatiallyadjacent in a process of generating a merge candidate list is notincluded.

Motion information corresponding to a position of the left 510, 511 and512 and a position of the top 520, 521, 522 and 523 may be used as mergecandidates which are spatially adjacent to CU 500 with the same size asMER shown in FIG. 5.

In this case, as a current CU 500 has the same size as MER, as mentionedabove, a process of excluding the corresponding merge candidates in aprocess of generating a merge candidate list with the merge candidateswhich are spatially adjacent is not performed.

But, when there is no motion information, i.e., when being a blockencoded in an intra prediction mode or when being positioned on theboundary of a picture, a slice or a tile, motion information at thecorresponding position may not be included as a merge candidate.

FIG. 6 is a diagram showing an embodiment on CU with a smaller size thanMER.

FIG. 6 is a diagram showing an example on CU 604 using a merge candidateat a position included in the same MER among a plurality of CUs with asmaller size than MER.

In addition, as shown in FIG. 6, it is suggested in the presentdisclosure that when a merge candidate included in the same MER isexcluded, a spatially-separated position by a distance of a plurality ofpixels outside MER for compensating it is used as an additional mergecandidate.

As FIG. 6 is a diagram showing an embodiment on CU 604 with a smallersize than MER, 604 CU is described as an embodiment to show that a mergecandidate at a position included in the same MER among a plurality ofCUs 601, 602, 603 and 604 with a smaller size than MER is excluded inFIG. 6.

When a spatially adjacent merge candidate of a current CU 604 existslike 610, 611, 621, 620 and 621 in FIG. 6, merge candidates 620 and 621at a position which is not encoded and decoded yet in encoding anddecoding a current CU are excluded from a merge candidate.

In addition, merge candidates 610, 611 and 612 included in the same MERas a current CU among the spatially adjacent merge candidates of thecurrent CU 604 are not added to a list in a process of generating amerge candidate list.

In case of an embodiment corresponding to the current CU 604, lossoccurs in a process of configuring a spatially adjacent merge candidatebecause spatially adjacent merge candidates are included in the same MER600 and excluded in a process of configuring a merge candidate list as acase of being excluded by the encoding and decoding order.

To solve it, the present disclosure suggests a method of configuring amerge candidate list which uses a merge candidate spatially positionedat a distance of a plurality of pixels as an additional merge candidate.In this case, as an embodiment in which a merge candidate positioned ata distance of a plurality of pixels is used as an additional mergecandidate, both a case that it is used when a merge candidate list isnot satisfied as many as the maximum number of merge candidates and acase that it is used when merge candidates included in the same MER areexcluded may be included.

As shown in FIG. 6, merge candidates 630, 631 and 632, which arepositioned at a specific pixel distance and have a specificdirectionality with merge candidates 610, 611 and 612 included in thesame MER 600 as a current CU, may be used as an additional mergecandidate.

According to an embodiment, a merge candidate 630 positioned in avertical direction of a merge candidate 610 included in the same MER asa current CU and positioned at a different MER may be added to the mergecandidate list of a current CU.

In addition, according to an embodiment, a merge candidate 631positioned in a diagonal direction of a merge candidate 611 included inthe same MER as a current CU and positioned at a different MER may beadded to the merge candidate list of a current CU.

In addition, according to an embodiment, a merge candidate 632positioned in a diagonal direction of a merge candidate 612 included inthe same MER as a current CU and positioned at a different MER may beadded to the merge candidate list of a current CU.

It means that merge candidates 630, 631 and 632 added to the mergecandidate list of a current CU 604 according to the embodiment may beused for a current CU 604 by configuring a merge list with the mergecandidates of a higher block 630 of a current CU 604.

FIG. 7 is a diagram showing another embodiment on CU with a smaller sizethan MER.

FIG. 7 is a diagram showing an example on CU 706 using a merge candidateat a position included in the same MER among a plurality of CUs with asmaller size than MER.

In addition, as shown in FIG. 7, it is suggested in the presentdisclosure that when a merge candidate included in the same MER isexcluded, a spatially-separated position by a distance of a plurality ofpixels outside MER for compensating it is used as an additional mergecandidate.

As FIG. 7 is a diagram showing an embodiment on CU 706 with a smallersize than MER, 706 CU is described as an embodiment to show that a mergecandidate at a position included in the same MER among a plurality ofCUs 705, 706 and 707 with a smaller size than MER is excluded in FIG. 7.

When a spatially adjacent merge candidate of a current CU 706 existslike 710, 711, 720, 730, 731 in FIG. 7, candidates 710 and 711 which areencoded and decoded in encoding and decoding a current CU and are notincluded in the same MER may be added to a merge candidate list whenmotion information is available for reference. In other words, motioninformation at the corresponding position 710 and 711 may be used as amerge candidate of a current CU 706.

In addition, a merge candidate 720 at a position which is not encodedand decoded yet in encoding and decoding a current CU is excluded from amerge candidate.

In addition, merge candidates 730 and 731 included in the same MER 700as a current CU among the spatially adjacent merge candidates of thecurrent CU 706 are not added to a list in a process of generating amerge candidate list.

In case of an embodiment corresponding to the current CU 706, lossoccurs in a process of configuring a spatially adjacent merge candidatebecause spatially adjacent merge candidates are included in the same MER700 and excluded in a process of configuring a merge candidate list as acase of being excluded by the encoding and decoding order.

To solve it, the present disclosure suggests a method of configuring amerge candidate list which uses a merge candidate spatially positionedat a distance of a plurality of pixels as an additional merge candidate.

In this case, as an embodiment in which a merge candidate positioned ata distance of a plurality of pixels is used as an additional mergecandidate, both a case that it is used when a merge candidate list isnot satisfied as many as the maximum number of merge candidates or acase that it is used when merge candidates included in the same MER areexcluded may be included.

As shown in FIG. 7, merge candidates 740, 741, 750 and 751, which arepositioned at a specific pixel distance and have a specificdirectionality with merge candidates 730 and 731 included in the sameMER 700 as a current CU, may be used as an additional merge candidate.

According to an embodiment, merge candidates 740 and 741 positioned in adiagonal direction of merge candidates 730 and 731 included in the sameMER as a current CU and positioned at a different MER may be added tothe merge candidate list of a current CU.

In addition, according to an embodiment, merge candidates 750 and 751positioned in a vertical direction of merge candidates 730 and 731included in the same MER as a current CU and positioned at a differentMER may be added to the merge candidate list of a current CU.

As shown in FIGS. 5, 6 and 7, dependency on a position included in thesame MER or PER as a current CU may be removed in encoding and decodinga current CU in parallel.

In this case, the size (or range) of MER or PER for parallel processingmay be transmitted by using a higher-level syntax.

In this case, a higher-level syntax may be transmitted by using one ormore parameter sets of a sequence parameter set (SPS), a pictureparameter set (PPS) or a slice header.

In addition, the size of the corresponding MER and PER may not belimited to a square shape, and a non-square with different width andheight. The width and height may be signaled independently.Alternatively, for the size (or range) of the corresponding MER or PER,using a predefined size may be also included in a scope of the presentdisclosure.

Interdependency between CUs included in the same MER or PER may beremoved, a merge candidate in a process of generating a merge candidatelist used in a motion prediction process and a motion predictioncandidate for motion prediction may be included, a region included inthe same MER or PER may be excluded additionally from a reference pixelconfiguration for calculating a linear parameter in inter-componentprediction and a template configuration for template matching, and amethod of using a region corresponding to a different MER or PER may beincluded in a scope of the present disclosure.

FIG. 8 shows a method in which a residual sample of a current block isencoded/decoded as an embodiment to which the present disclosure isapplied.

To reconstruct a residual sample of a current block to be transformed,at least one of inverse transform in a vertical direction or inversetransform in a horizontal direction may be performed. Inverse transformof the present disclosure may be implemented by 2D-inverse transform ormay be implemented by 1D-inverse transform for each vertical/horizontaldirection.

For example, one or more K*L transforms may be applied to L*K transformcoefficients to reconstruct a residual sample of a current block in aK×L size. In this case, when K and L is the same, square or non-squaretransform may be applied.

Alternatively, inverse transform may be performed for a block which ishalf the size of a current block to reconstruct a K*L current block. Forexample, K*L/2 transform and/or K/2*L transform may be applied to aL/2*K/2 transform coefficient to reconstruct a residual sample of a K×Lcurrent block. Likewise, when K and L are the same, square or non-squaretransform may be applied. K*L/2 transform may correspond to part of theK*L transform. In addition, K/2*L transform may correspond to part ofK×L transform. To reconstruct a K*L transform coefficient, K*L/2transform may be performed and may be implemented in whole or in part ina butterfly structure in some cases. This butterfly structuralcalculation may correspond to part of a K*L butterfly structure. Toreconstruct a K*L residual sample, K/2*L transform may be performed andmay be implemented in whole or in part in a butterfly structure in somecases. This butterfly structural calculation may correspond to part of aK*L butterfly structure.

To reconstruct a residual sample of a K*L current block, inversetransform with a size of P×O may be performed. P is smaller than K, andO is smaller than L. In this case, K*0 transform and/or P*L transformmay be applied to O×P transform coefficients. In this case, when K and Lare the same, square or non-square transform may be applied. Inaddition, O and P may be the same, O may be an integer smaller than orthe same as L, and P may be an integer smaller than or the same as K. Inthis case, K*O transform may correspond to part of K*L transform, andP*L transform may correspond to part of K*L transform. To reconstruct aresidual sample of a K*L current block, K*O transform may be performedthrough matrix operation. In some cases, implementation is possible inwhole or in part in a butterfly structure. This butterfly structuralcalculation may correspond to part of a K*L butterfly structure.

To reconstruct a K*L residual signal, P*L primary transform may bepossible through matrix operation and in some cases, may be implementedin part or in whole in a butterfly structure. This butterfly structuralcalculation may correspond to part of a K*L butterfly structure.

A K*L current block may be obtained by 2D-inverse transforming L*Ktransform coefficients. Such 2D-inverse transform may be performed byperforming 1D-inverse transform in a horizontal direction and a verticaldirection, respectively or simultaneously. Such a process may berepresented by matrix calculation and 1D-inverse transform in ahorizontal direction and in a vertical direction may be calculated bythe matrix product of a preceding clause and a succeeding clause.

To indicate such a case in a bitstream, a determination may be made byone flag or mode. Alternatively, a determination may be made accordingto inter prediction and intra prediction, and may be made by the maximumprediction size or the maximum transform size in one CTU. As anembodiment, in case of an inter or intra prediction block or in case ofthe largest prediction or transform block, inverse transform smallerthan that block may be used all the time. When being smaller than thelargest block, a residual sample is reconstructed by inverse transformwith the same size as that block all the time. Smaller transform may beused all the time, but a determination may be made by information suchas a flag, etc. as mentioned above. Alternatively, inverse transformsmaller than a size of a residual block may be used when a highfrequency component is not included in a transform coefficient and acoefficient exists only in a partial region in terms of reconstruction.

In addition, when the size of a coding block currently performingencoding and decoding is greater than the maximum transform size,transform and inverse transform may be performed by partition into themaximum transform size without additional signaling. In this case, whenthe corresponding coding block is square, it includes partitioning oneblock into a plurality of transform blocks by using the maximumtransform size to have the same number of columns and rows. On the otherhand, when the corresponding coding block is non-square, one block maybe partitioned into a plurality of transform blocks by using the maximumtransform size to have the same number of columns and rows, but atransform block may be also kept as the same square block as the maximumtransform size and the number of transform blocks may vary according tothe width and height of a coding block. Hereinafter, in reference toFIG. 8, a method of reconstructing a residual sample will be describedin detail.

First, a transform unit 130 of an image encoding device may obtain atransform coefficient by performing transform for a sample of a residualblock, i.e., a residual sample. A quantization unit 135 may obtain aquantized transform coefficient by performing quantization for thetransform coefficient.

A transform unit 130 may additionally perform transform for thetransform coefficient. Hereinafter, transform which is applied to aresidual sample is referred to as first transform and transform which isapplied to a transform coefficient according to the first transform isreferred to as second transform. But, the second transform is notlimited to being performed between the first transform and quantization.For example, the second transform may be performed before the firsttransform. Alternatively, a transform coefficient may be obtained byperforming only the second transform for a residual sample and the firsttransform may be omitted.

The above-mentioned second transform may be performed based on at leastone of a size or shape of a current block (or a residual block). Forexample, when the size of a current block is smaller than apredetermined threshold value, a N*N transform matrix may be applied.Otherwise, a M*M transform matrix may be applied. In this case, N may bean integer such as 4, 8 or more and M may be an integer such as 8, 16 ormore. N may be smaller than M. The threshold value may be an integersuch as 8, 16 or more.

In an example, when the minimum value of width or height of a currentblock is smaller than 8, the second transform may be performed based ona 4×4 transform matrix. Alternatively, when the minimum value of widthor height of a current block is greater than or the same as 8, thesecond transform may be performed based on a 8×8 transform matrix.

But, a transform matrix for the second transform is not limited to asquare shape and a non-square transform matrix may be used. The secondtransform based on a non-square transform matrix may be a process ofmapping a (W*H)-sized current block into a (w1*h1)-sized sub-block. Asub-block may mean a partial region of a current block. In other words,w1 may be greater than 0 and smaller than or the same as W, and h1 maybe greater than 0 and smaller than or the same as H. The partial regionmay be a w1*h1 block positioned at the left, the top or the top-leftwithin a current block. As a result of the second transform, only anonzero transform coefficient may be generated in a sub-block and only azero transform coefficient may be generated in the remaining region of acurrent block. The size/shape of the sub-block may be variablydetermined based on the size of the above-mentioned transform matrix.Alternatively, the number of nonzero transform coefficients belonging toa sub-block may be variably determined based on the size of a transformmatrix.

On the other hand, a dequantization unit 220 of an image decoding devicemay obtain a dequantized transform coefficient by performingdequantization for a transform coefficient obtained in a bitstream. Aninverse transform unit 225 may reconstruct a residual sample byperforming inverse transform for a dequantized transform coefficient.

An inverse transform unit 225 may perform additional inverse transformbetween the dequantization and the inverse transform. Hereinafter,additional inverse transform is referred to as second inverse transform,and inverse transform which is applied to a transform coefficientaccording to the second inverse transform is referred to as firstinverse transform. But, the second inverse transform is not limited tobeing performed between dequantization and the first inverse transform.For example, the second inverse transform may be performed after thefirst transform. Alternatively, a residual sample may be reconstructedby performing the second inverse transform for a dequantized transformcoefficient and in this case, the first inverse transform may beomitted.

The above-mentioned second inverse transform may be performed based onat least one of a size or a shape of a current block (or a residualblock). A transform matrix for the second inverse transform is asdescribed in the second transform process and herein, detaileddescription will be omitted.

In addition, for a transform matrix for the second inverse transform, anon-square transform matrix as well as a square transform matrix may beused. The second inverse transform based on a non-square transformmatrix may be understood as an inverse process of the above-mentionedsecond inverse transform. In other words, the second inverse transformmay be a process of mapping a (w1*h1)-sized sub-block into a (W*H)-sizedcurrent block. In this case, a sub-block may mean a partial region of acurrent block. In other words, w1 may be greater than 0 and smaller thanor the same as W and h1 may be greater than 0 and smaller than or thesame as H. The partial region may be a w1*h1 block positioned at theleft, the top or the top-left within a current block. Through the secondinverse transform, a (W*H)-sized transform coefficient of a currentblock may be generated from a (w1*h1)-sized transform coefficient of asub-block. Based on the size/shape of the transform matrix, at least oneof a size, a shape, a position, or the number of nonzero transformcoefficients of a sub-block mapped to a current block may be determined.

The above-mentioned transform matrix may be determined from a pluralityof transform sets. The number of transform sets which are predefined inan image encoding/decoding device may be 1, 2, 3, 4 or more. Eachtransform set may be configured with one or more transform matrixes. Inthis case, for a transform set of a current block, informationspecifying a transform set may be signaled from an image encodingdevice. Alternatively, the transform set of a current block may bedetermined by considering a size, a shape, a partition type, a componenttype (e.g., a luma/chroma component), whether an intra prediction modeis nondirectional, an angle of an intra prediction mode, whether anonzero transform coefficient exists, whether transform is skipped, etc.of a block. In this case, whether transform is skipped may mean whetherthe first inverse transform is performed. In an example, a transform setmay be selected based on an intra prediction mode (IntraPredMode) as thefollowing Table 1. But, when an intra prediction mode of a current blockrepresents an inter-component prediction mode, a transform set may bedetermined based on a transform set index which is pre-promised in animage encoding/decoding device.

TABLE 1 IntraPredMode Transform Set Index IntraPredMode < 0 1 0 <=IntraPredMode <= 1 0  2 <= IntraPredMode <= 12 1 13 <= IntraPredMode <=23 2 24 <= IntraPredMode <= 44 3 45 <= IntraPredMode <= 55 2 56 <=IntraPredMode 1

A transform matrix of a current block may be determined based on any oneof a plurality of transform types (or transform matrixes) belonging tothe selected transform set. For this, a separate index may be signaledfrom an image encoding device. The index may represent whether theabove-mentioned second inverse transform is performed. Alternatively,the index may represent whether the second inverse transform based onthe above-mentioned non-square transform matrix is performed. Inaddition, the index may specify any transform type of preselectedtransform set.

For example, when the index is a first value, the second inversetransform may be skipped, and when the index is a second value, thesecond inverse transform may be performed based on a transform typecorresponding to the second value.

Alternatively, the index may include a first index representing whetherthe second inverse transform is performed and a second index specifyinga transform type. In this case, when the first index is a first value,the second inverse transform may be performed and otherwise, the secondinverse transform may be skipped. When the first index is the firstvalue, the second index may be signaled, and a transform type may bedetermined based on the signaled second index.

The second inverse transform may be performed only when a predeterminedcondition is satisfied.

For example, in a current block, the second inverse transform may beselectively performed by considering whether a nonzero transformcoefficient exists in a region excluding the above-mentioned sub-block.In other words, when a nonzero transform coefficient exists in a regionexcluding a sub-block, it means the second transform is not performed inan image encoding device. Accordingly, the second inverse transform maybe performed only when whether a nonzero transform coefficient exists isconfirmed for at least one of the right, the bottom or the bottom-rightregion of a current block and a nonzero transform coefficient does notexist in the corresponding region. Alternatively, only when a nonzerotransform coefficient does not exist in the corresponding region, anindex may be signaled, and the second inverse transform may beselectively transformed based on a signaled index.

Alternatively, the second inverse transform may be performed when thesize of a current block is greater than or the same as a predeterminedthreshold value. The threshold value may be an integer such as 4, 8 ormore. When the width and height of a current block are greater than orthe same as a threshold value, the second inverse transform may beapplied. Alternatively, even when any one of width or height of acurrent block is greater than or the same as the threshold value, thesecond inverse transform may be implemented to be applied.

Alternatively, only when the first inverse transform for a current blockis performed, the second inverse transform may be performed.

Alternatively, only when a current block is a block encoded by an intramode, the second inverse transform may be performed. But, whensub-block-based intra prediction for a current block is performed, itmay be limited so that the second inverse transform is not performed.Sub-block-based intra prediction is as described in FIG. 3 and herein,detailed description will be omitted.

The second inverse transform may be limitedly performed by consideringonly any one of the above-mentioned conditions. Alternatively, thesecond inverse transform may be limitedly performed based on acombination of at least two conditions.

FIG. 9 is an example of second transform according to a block size/shapeas an embodiment to which the present disclosure is applied.

In reference to FIG. 9, it is assumed that a current block to betransformed is a block having a N*M size/shape. A N*M block 900 mayinclude a transform coefficient generated by the first transform.

An image encoding device may perform the second transform for atransform coefficient of the N*M block 900 and in this case, thetransform coefficient of a N*M block 900 may be mapped into a transformcoefficient belonging to a partial region of a N*M block 900. In thiscase, a N*M block 900 may be square (N=M) or may be non-square (N<M,N>M). The partial region may be a top-left region 910 within a N*M block900 or may be a top region 920 or a left region 930 within a N*M block900.

Alternatively, when at least one of width or height of a N*M block 900is greater than a predetermined threshold size, a N*M block 900 may bepartitioned into a plurality of sub-blocks based on a predeterminedpartition type, and the second transform may be performed only for atleast one of a plurality of sub-blocks. The threshold size may be aninteger such as 8, 16 or more. The partition type may be performed basedon at least one of quad tree, binary tree or ternary tree.Alternatively, the partition may be performed only by one or morevertical lines or only by one or more horizontal lines. In this case,the second transform may be applied to a sub-block positioned at thetop-left, the left or the top of a plurality of sub-blocks. But, it isnot limited thereto and it may be applied to a sub-block positioned atat least one of the top-right, the bottom-left, the bottom-right, theright or the bottom. The transform coefficient of a sub-block to whichthe second transform is applied may be mapped into a transformcoefficient belonging to a partial region of the correspondingsub-block. In this case, a partial region may be a region positioned atthe top-left, the top or the left of the corresponding sub-block.

For example, as shown in FIG. 9, a N*M block 900 may be partitioned intofour sub-blocks based on quad tree, and the second transform may beperformed only for a top-left sub-block among four sub-blocks. In thiscase, the transform coefficient of a top-left sub-block may be mappedinto a transform coefficient of a top-left region 940 within a top-leftsub-block.

Alternatively, an image encoding device may perform the second transformfor a transform coefficient of the N*M block 900 and in this case, thetransform coefficient of a N*M block 900 may be mapped into a transformcoefficient belonging to the whole region 950 of a N*M block 900.

The transform coefficient belonging to a partial region and/or a wholeregion which is mapped may be all nonzero transform coefficients or mayinclude at least one nonzero transform coefficient. In addition, in aregion to which the second transform is applied, a zero transformcoefficient may be generated in the remaining region excluding themapped partial region.

An image decoding device may generate a transform coefficient of a N*Mblock 900 in an inverse process of the above-mentioned second transform.In other words, the transform coefficient of a N*M block 900 may begenerated by performing the second inverse transform for a transformcoefficient in a partial region.

The above-mentioned mapping relation may be determined based on at leastone of a size (at least one of width and height), a shape, a ratio ofwidth and height, or a partition type of a N*M block 900, andhereinafter, it will be described in detail.

1. When N=M=8

When a current block is a 8×8 block, a 16×64 transform matrix may beapplied in an image encoding device. 8×8 transform coefficients in the2D shape may be represented as 64×1 transform coefficients in a 1Dshape. Through the second transform, 64×1 transform coefficients may bemapped into 16×1 transform coefficients and it may be rearranged into a4×4 block in a 2D shape based on the predetermined scanning order. Inother words, a transform coefficient of the 8×8 block resulting from thefirst transform may be mapped into a transform coefficient of a 4×4block through the second transform. In this case, the 4×4 block may haveonly a nonzero transform coefficient and it may be positioned at thetop-left within a 8×8 block. Only a zero transform coefficient may begenerated in the remaining region excluding the 4×4 block in the 8×8block. In an image decoding device, through an inverse process of theabove-mentioned second transform, a transform coefficient of a 8×8 blockmay be generated from a transform coefficient of a 4×4 block, a partialregion in a 8×8 block.

Alternatively, when a current block is a 8×8 block, a 8×64 transformmatrix may be applied. Likewise, 8×8 transform coefficients in the 2Dshape may be represented as 64×1 transform coefficients in a 1D shape.Through the second transform, 64×1 transform coefficients may be mappedinto 8×1 transform coefficients and it may be rearranged into a 4×2block (or a 2×4 block) in a 2D shape based on the predetermined scanningorder. In other words, a transform coefficient of the 8×8 blockresulting from the first transform may be mapped into a transformcoefficient of a 4×2 block (or a 2×4 block) through the secondtransform. In this case, the 4×2 block (or a 2×4 block) may have only anonzero transform coefficient and it may be positioned at the top-leftwithin a 8×8 block. In the 8×8 block, only a zero transform coefficientmay be generated in the remaining region excluding the 4×2 block (or the2×4 block). In an image decoding device, through an inverse process ofthe above-mentioned second transform, a transform coefficient of a 8×8block may be generated from a transform coefficient of a 4×2 block (or a2×4 block), a partial region in a 8×8 block.

When a current block is a 8×8 block, any one of transform matrixes withthe predetermined size may be selectively used. The selection may beperformed based on at least one of a size, a shape, or a partition type(e.g., quad tree, binary tree, ternary tree) of a block. In this case, ablock may mean at least one of a current block, a spatial neighboringblock of a current block or a higher block to which a current blockbelongs. A higher block may mean a block with a smaller split depth thana current block. For example, when only a square block is included in ahigher block, a small size-transform matrix (e.g., a 8×64 transformmatrix) may be used and otherwise, a large size-transform matrix (e.g.,a 16×64 transform matrix) may be used. Alternatively, when a currentblock is partitioned based on quad tree, a small size-transform matrix(e.g., a 8×64 transform matrix) may be used and otherwise, a largesize-transform matrix (e.g., a 16×64 transform matrix) may be used. Amethod of selectively using the above-mentioned transform matrix may beapplied the same as in the after-mentioned embodiment.

2. When N=M=4

When a current block is a 4×4 block, a 16×16 transform matrix may beapplied in an image encoding device. 4×4 transform coefficients in the2D shape may be represented as 16×1 transform coefficients in a 1Dshape. Through the second transform, 16×1 transform coefficients may bemapped into 16×1 transform coefficients and it may be rearranged into a4×4 block in a 2D shape based on the predetermined scanning order. Inother words, a transform coefficient of the 4×4 block resulting from thefirst transform may be mapped into the transform coefficient of a 4×4block through the second transform. In this case, the 4×4 block may haveonly a nonzero transform coefficient. In an image decoding device, in aninverse process of the above-mentioned second transform, a transformcoefficient of a 4×4 block may be generated from a transform coefficientof a 4×4 block.

Alternatively, when a current block is a 4×4 block, a 8×16 transformmatrix may be applied. Likewise, 4×4 transform coefficients in the 2Dshape may be represented as 16×1 transform coefficients in a 1D shape.Through the second transform, 16×1 transform coefficients may be mappedinto 8×1 transform coefficients and it may be rearranged into a 4×2block (or a 2×4 block) in a 2D shape based on the predetermined scanningorder. In other words, a transform coefficient of the 4×4 blockresulting from the first transform may be mapped into the transformcoefficient of a 4×2 block (or a 2×4 block) through the secondtransform. In this case, the 4×2 block (or a 2×4 block) may have only anonzero transform coefficient and it may be positioned at the top (orthe left) within a 4×4 block. Only a zero transform coefficient may begenerated in the remaining region excluding the 4×2 block (or the 2×4block) within the 4×4 block. In an image decoding device, in an inverseprocess of the above-mentioned second transform, a transform coefficientof a 4×4 block may be generated from a transform coefficient of a 4×2block (or a 2×4 block), a partial region in a 4×4 block.

3. When N*M>8×8

When a current block is greater than a 8×8 block, an image encodingdevice may perform the second transform for a whole or partial region ofa current block. For example, the second transform may be performed per8×8 block in a current block. Alternatively, the partial region may be a8×8 block positioned at at least one of the left, the top or thetop-left within a current block. In this case, the second transform maybe performed based on a 16×64 transform matrix and it is the same asshown in the section 1. when N=M=8. In an example, when a current blockis 16×16, the transform coefficient of a top-left 8×8 block of a currentblock may be mapped into the transform coefficient of a top-left 4×4block of a current block through the second transform. In this case, the4×4 block may have only a nonzero transform coefficient and only a zerotransform coefficient may be generated in the remaining region excludingthe 4×4 block within a top-left 8×8 block. And, 8×8 blocks positioned atthe top-right, the bottom-left and the bottom-right of a current blockmay be configured with a transform coefficient resulting from the firsttransform. In an image decoding device, through an inverse process ofthe above-mentioned second transform, a transform coefficient of atop-left 8×8 block may be generated from a transform coefficient of a4×4 block, a partial region of a top-left 8×8 block within a currentblock. The transform coefficients of remaining 8×8 blocks may begenerated by dequantization.

But, the embodiment is not limited to a 16×64 transform matrix and a8×64 transform matrix may be applied. It is the same as shown in thesection 1. when N=M=8 and herein, detailed description will be omitted.

4. When N*M is 4×8 or 8×4

When a current block is a 4×8 block (or a 8×4 block), an image encodingdevice may perform the second transform for a whole or partial region ofa current block. For example, the second transform may be performed per4×4 block in a current block. Alternatively, the partial region may be a4×4 block positioned at at least one of the left or the top of a currentblock. In this case, the second transform may be performed based on a16×16 transform matrix and it is the same as shown in the section 2.when N=M=4. In an example, when a current block is 4×8, the transformcoefficient of a top 4×4 block of a current block may be mapped into thetransform coefficient of a top 4×4 block of a current block through thesecond transform. And, a bottom 4×4 block of a current block may beconfigured with a transform coefficient resulting from the firsttransform. In an image decoding device, through an inverse process ofthe above-mentioned second transform, a transform coefficient of a top4×4 block may be generated from a transform coefficient of a top 4×4block within a current block. And, a transform coefficient of a bottom4×4 block may be generated by dequantization.

But, the embodiment is not limited to a 16×16 transform matrix and a8×16 transform matrix may be applied. It is the same as shown in thesection 2. when N=M=4. In an example, when a current block is 4×8, thetransform coefficient of a top 4×4 block of a current block may bemapped into the transform coefficient of a top 4×2 block (or a left 2×4block) of a current block through the second transform. In this case, atop 4×2 block (or a left 2×4 block) may have only a nonzero transformcoefficient and only a zero transform coefficient may be generated inthe remaining region excluding a top 4×2 block (or a left 2×4 block)within a top 4×4 block. And, a bottom 4×4 block of a current block maybe configured with a transform coefficient resulting from the firsttransform. In an image decoding device, through an inverse process ofthe above-mentioned second transform, a transform coefficient of a top4×4 block within a current block may be generated from a transformcoefficient of a top 4×2 block (or a left 2×4 block) within a currentblock. And, a transform coefficient of a bottom 4×4 block within acurrent block may be generated by dequantization.

5. When any One of N or M is Greater than or the Same as 16.

When any one of width or height of a current block is greater than orthe same as 16, an image encoding device may perform the secondtransform for a whole or partial region of a current block. For example,the second transform may be performed per 4×4 block in a current block.Alternatively, the partial region may be a 4×4 block positioned at atleast one of the left or the top of a current block. The partial regionmay further include one or more 4×4 blocks which neighbor a 4×4 blockpositioned at the left or the top in a right or bottom direction. Inthis case, the second transform may be performed based on a 16×16transform matrix or a 8×16 transform matrix and it is the same as shownin the section 2. when N=M=4.

FIG. 10 shows a second transform method according to a transform matrixsize as an embodiment to which the present disclosure is applied.

The second transform may be performed based on a R*C transform matrix.In this case, the second transform may be a process of mapping Ctransform coefficients belonging to the current block resulting from thefirst transform into R transform coefficients. In other words, bycontrolling a value of C for a R*C transform matrix, a range of a regionwhere the second transform is performed and which is mapped to Rtransform coefficients may be variably determined.

For example, when the second transform is performed based on a 16×64transform matrix, 64 transform coefficients (e.g., a 8×8 block)belonging to the current block resulting from the first transform may bemapped to 16 transform coefficients (e.g., a 4×4 block). Alternatively,when the second transform is performed based on a 16×48 transformmatrix, 48 transform coefficients belonging to the current blockresulting from the first transform may be mapped to 16 transformcoefficients.

In FIG. 10, it is assumed that a current block 1000 has a N*M size andis a block resulting from the first transform, and N and M are greaterthan or the same as 8, respectively.

In an image encoding device, when the second transform is performedbased on a 16×48 transform matrix, 48 transform coefficients belongingto a current block may be mapped to 16 transform coefficients. In thiscase, 48 transform coefficients may belong to a top-left 8×8 block 1010within a current block. In particular, 48 transform coefficients maybelong to a top-left 4×4 block 1020, a top-right 4×4 block 1030 and abottom-left 4×4 block 1040 within the top-left-top 8×8 block 1010. 16transform coefficients generated by the second transform may belong to atop-left 8×8 block 1010 within a current block. And, among regions wherethe second transform is performed, a zero transform coefficient may begenerated in the remaining 4×4 blocks 1030 and 1040.

When the second transform is performed based on a 16×48 transform matrixin an image encoding device, an image decoding device may derivetransform coefficients of a top-left 4×4 block 1020, a top-right 4×4block 1030 and a bottom-left 4×4 block 1040 from transform coefficientsof a top-left 4×4 block 1020 within a current block through the secondinverse transform based on a 48×16 transform matrix.

FIG. 11 is a diagram showing a conceptual diagram on a method of storinga compressed motion vector.

FIG. 11 shows a method of compressing and storing a motion vector of atarget image block in a unit of a certain block size in encoding anddecoding. In this case, compression in a unit of the certain block sizerefers to storing a motion vector and reference index informationcorresponding to a group unit of specific pixels as a representativevalue obtained by at least one method of sub-sampling, an average valueor a median value.

In FIG. 11, one unit block exists and motion information of thecorresponding block may be applied in a pixel unit, but storage may bepossible in a certain block unit due to an issue such as storage memoryoptimization, hardware implementation, etc. In addition, a motion vectormay be additionally compressed to refer to such motion information in adifferent picture which is temporally adjacent.

FIG. 11 is a diagram showing a concept that motion information is storedbased on compression in storing motion information. In this case,compressing motion information refers to storing a motion vector andreference index information corresponding to a group unit of specificpixels as a representative value obtained by at least one method ofsub-sampling, an average value or a median value.

In addition, in compressing the motion information, when a size of apixel block corresponding to that compressed target motion may be 4×4,8×8, 16×16, 32×32 and 64×64.

FIG. 12 is an embodiment on a method of storing a motion vectoraccording to the present disclosure.

In particular, FIG. 12 shows a method of extracting a motion vector of atarget image block in encoding and decoding. In this case, as shown inFIG. 12, a motion vector of a K×L pixel block is stored according toinput spatial resolution. In addition, a method of storing based on abit depth according to the accuracy or resolution of a motion vector isshown.

In FIG. 12, one unit block (N×M) may be a square or non-square block. Inthis case, the square or non-square block may be recursively partitionedbased on a variety of tree types and may be partitioned by usingquad-tree block partition, binary-tree block partition and ternary-treeblock partition.

When one unit block shown in FIG. 12 is partitioned, a motion vector ofa non-square or square partial block of K×L is stored as MV1 and MV2with input spatial resolution. In this case, MV1 and MV2 may be adifferent reference image, respectively, and an index of this referenceimage may be separately stored. In addition, the motion vector of a K×Lblock is modified to fit the spatial resolution and stored.

In an example, when a motion vector of a 8×16 block is stored at 4×4resolution, 8×16 is stored by being partitioned into eight 4×4.Inversely, when being stored at 16×16 resolution, storage may beperformed by selecting one of blocks corresponding to 16×16 resolutionor extracting a representative vector such as average, etc. In thiscase, a motion vector of a K×L block may be determined by a variety ofbit depth according to a coding method.

In this case, in storing a motion vector, it may be stored as a bitdepth designating the accuracy of a generated motion vector. Forexample, when a motion vector of a K×L block is calculated by ⅛accuracy, it may be modified according to the bit depth and may bestored. For example, it may be stored by ¼ accuracy or 1/16 accuracy,etc. Such a process is performed by an operation such as shift, etc.

FIG. 13 is an embodiment on a method of extracting a motion vectoraccording to the present disclosure.

In particular, FIG. 13 shows a method of extracting a motion vector of atarget image block in encoding and decoding. In this case, as shown inFIG. 13, a method of extracting a motion vector corresponding to a K×Lpixel block or extracting a motion vector at a specific coordinate isshown. A stored motion vector which is corresponding according tospatial resolution should be extracted to extract a stored motionvector, and should be extracted by modifying bit depth according to theaccuracy of a motion vector.

When one unit block shown in FIG. 13 is partitioned, MV1 and MV2corresponding according to spatial resolution should be extracted toextract a motion vector which is corresponding to a rectangular orsquare partial block of K×L or to extract a motion vector at a specificcoordinate. In some cases, only one motion vector may be extracted. Inthis case, MV1 and MV2 may be a different reference image, respectivelyand an index of a reference image which is separately stored with amotion vector is extracted.

In addition, for extracting a motion vector corresponding to a K×Lblock, that block extracts a motion vector corresponding to a top-leftcoordinate by considering spatial resolution. In an example, forextracting a motion vector corresponding to a 8×16 decoding block, amotion vector stored at 4×4 resolution and corresponding to the top-leftof that block is extracted. Alternatively, a representative value suchas one of a plurality of 4×4 resolution blocks corresponding to a 8×16decoding block or an average, etc. of more than one 4×4 resolution blockis used. Inversely, when a decoding block is smaller than motion vectorstorage resolution, a corresponding block uses by extracting a motionvector.

In this case, a motion vector stored with a specific bit depth isextracted, but is changed to a bit depth required for a decoding blockin order to be used by the decoding block. For example, when it isstored with ½ bit depth, but a motion vector with ⅛ bit accuracy isrequired, it is necessary to adjust the accuracy of a motion vector byan operation such as shift, etc. to fit it.

To store and extract a motion vector and a reference image, bit depthand spatial resolution may be indicated and parsed from a bitstream toperform image encoding and decoding.

By changing bit depth and spatial resolution for storing a motion vectorand a reference image, it is possible to deal with a problem for adevice memory capacity.

According to an image sequence, bit depth and spatial resolution forstoring and extracting other motion vectors and reference images may bechanged. For example, a motion vector and a reference image resolutionsuch as 4×4, 16×16, 32×32, etc. may be stored, bit depth may be storedin an integer pixel unit, ½, ¼, 1/16, etc. in storing each motion vectorand it may be indicated in a bitstream.

A variety of embodiments of the present disclosure do not enumerate allpossible combinations, but are to describe the representative aspect ofthe present disclosure and matters described in various embodiments maybe independently applied or may be applied by two or more combinations.

In addition, a variety of embodiments of the present disclosure may beimplemented by a hardware, a firmware, a software, or their combination,etc. For implementation by a hardware, implementation may be performedby one or more ASICs (Application Specific Integrated Circuits), DSPs(Digital Signal Processors), DSPDs (Digital Signal Processing Devices),PLDs (Programmable Logic Devices), FPGAs (Field Programmable GateArrays), general processors, controllers, microcontrollers,microprocessors, etc.

A range of the present disclosure includes software ormachine-executable instructions (e.g., an operating system, anapplication, a firmware, a program, etc.) which execute an actionaccording to a method of various embodiments in a device or a computerand a non-transitory computer-readable medium that such software orinstructions, etc. are stored and are executable in a device or acomputer.

INDUSTRIAL APPLICABILITY

The present disclosure may be used for image encoding/decoding.

1. An image decoding method, comprising: configuring a merge candidatelist of a current block; deriving motion information of the currentblock based on the merge candidate list and a merge candidate index; andperforming inter prediction of the current block based on the derivedmotion information, wherein the merge candidate list includes aplurality of merge candidates, and wherein the plurality of mergecandidates are determined based on at least one of a position or a sizeof a predetermined merge estimation region to which the current blockbelongs.
 2. The method of claim 1, wherein the merge estimation regionis a region where a plurality of coding units belonging to the mergeestimation region share one merge candidate list.
 3. The method of claim1, wherein the plurality of merge candidates include at least one of aspatial neighboring block or a temporal neighboring block of the mergeestimation region.
 4. The method of claim 3, wherein the current blockmeans a coding unit which is no longer partitioned into a smaller codingunit, and wherein the merge estimation region is a higher coding unitwith a split depth smaller than the current block.
 5. The method ofclaim 1, further comprising: setting position information and sizeinformation of the current block as position information and sizeinformation of the merge estimation region, respectively.
 6. The methodof claim 1, wherein the merge estimation region is set based on at leastone of a size or a partition method of a block, and wherein the blockincludes at least one of the current block or a higher coding unit forthe current block.
 7. The method of claim 6, wherein when a number ofsamples belonging to the higher coding unit of the current block is lessthan or equal to a predetermined first threshold value, the highercoding unit is set as the merge estimation region.
 8. The method ofclaim 6, wherein when the higher coding unit of the current block ispartitioned based on a predetermined partition method and a number ofsamples belonging to the higher coding unit is less than or equal to apredetermined second threshold value, the higher coding unit is set asthe merge estimation region.
 9. The method of claim 8, wherein thepartition method is any one of a quad-tree block partition, abinary-tree block partition or a ternary-tree block partition, andwherein the second threshold value is 32, 64, 128 or 256.